package com.example.demo.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.concurrent.Delayed;
import java.util.concurrent.TimeUnit;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class DelayTask2 implements Delayed {
    private String name;
    private Long delay;

    @Override
    public long getDelay(TimeUnit unit) {

        return this.delay;
    }

    @Override
    public int compareTo(Delayed o) {
        return 1;
    }
    public void saySomething(){
        System.out.println(name+delay+"...............");

    }
}
